<?php
if (isset($_POST['tijiao']))
{
    $yw=$_POST['yw'];
    $sx=$_POST['sx'];
    if ($yw=''||!is_numeric($yw)||$yw<0||$yw>100)
    {
        echo "语文成绩要在0-100中间";
    }
    else if ($sx=''||!is_numeric($sx)||$sx<0||$sx>100)
    {
        echo "shuxue成绩要在0-100中间";
    }
    else
    {
        $avg=($yw+$sx)/2;
        echo "你的平均分是：{$avg}";
        if ($avg>=90)
        {
            echo "宝贝,first blood";
        }
        elseif ($avg>=80)
        {
            echo "8888";
        }
        elseif ($avg>=70)
        {
            echo "77777";
        }
        elseif ($avg>=60)
        {
            echo "还可以";
        }
        else
        {
            echo "jiayou";
        }
    }


}
?>
<form method="post" action="">
    语文成绩：<input type="text"name="yw"><br>
    数学成绩：<input type="text" name="sx"><br>
    <input type="submit" name="tijiao" value="判断成绩">
</form>
